<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <meta HTTP-EQUIV="Expires" CONTENT="0">
    <link href="../pic/logo.ico" rel="shortcut icon">
    <link rel="stylesheet" href="../lib/element/index.css">
    <link rel="stylesheet" href="../../node_modules/animate.css/animate.min.css">
    <link href="../lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../common/common.css">
    <title>项目设置</title>
</head>
<body>
<div class="container" id="app" v-cloak="">
    <mainnav>
        <el-row class="row" style="text-align: center;height: 60px;line-height: 60px;font-size: 25px;color: #20A0FF" slot="title">项目设置</el-row>
        <el-button type="text"  style="font-size: 30px;width:40px;height: 60px" slot="slot2" onclick="history.back()" title="返回">
            <i class="fa fa-arrow-circle-left"></i>
        </el-button>
    </mainnav>
    <el-row class="row" style="margin-top:20px">
        <el-col class="col" :span="6" style="padding: 0 10px 0 10px">
            <div style="width: 100%;background-color: white;text-align: center;border-radius: 5px;box-shadow: 0px 2px 2px #888888;">
                <el-button type="primary" style="margin: 20px 0 0 0;width: 80%;" @click="type=0">
                    修改项目信息
                </el-button><el-button type="primary" style="margin: 20px 0 0 0;width: 80%;" @click="type=1">
                    修改baseUrl
                </el-button><el-button type="primary" style="margin: 20px 0 20px 0;width: 80%;" @click="type=2">
                    修改项目组员
                </el-button>
            </div>
        </el-col>
        <el-col class="col" :span="18" style="padding: 0 10px 0 10px">
            <div style="width: 100%;background-color: white;border-radius: 5px;box-shadow: 0px 2px 2px #888888;">
                <div v-if="type==0" class="row">
                    <el-row class="row" style="height: 60px;">
                        <h4 style="margin-left: 10px;color: gray">
                            项目信息
                        </h4>
                    </el-row>
                    <el-form ref="form" label-width="100px">
                        <el-form-item label="名称" style="text-align: center">
                            <el-input style="margin-top: 8px;width: 80%" disabled v-model="session.projectName"></el-input>
                        </el-form-item>
                        <el-form-item label="简介" style="text-align: center">
                            <el-input type="textarea" :rows="3" style="width: 80%;height: 80%;margin-top: 8px;" v-model="project.dis"></el-input>
                        </el-form-item>
                        <el-row class="row" style="text-align: center">
                            <el-col class="col" :span="12" style="text-align: center">
                                <el-button type="primary" style="width: 60%;margin-top: 20px;margin-bottom: 20px" @click.prevent="saveInfo" :loading="infoPending">
                                    保存
                                </el-button>
                            </el-col>
                            <el-col class="col" :span="12" style="text-align: center">
                                <el-button type="danger" style="width: 60%;margin-top: 20px;margin-bottom: 20px" @click.prevent="removeProject" :loading="deletePending">
                                    {{session.own==1?'删除项目':'退出项目'}}
                                </el-button>
                            </el-col>
                        </el-row>
                    </el-form>
                </div>
                <div v-else-if="type==1" class="row">
                    <el-row class="row" style="height: 60px;">
                        <h4 style="margin-left: 10px;color: gray">
                            修改baseUrl
                        </h4>
                    </el-row>
                    <urllist :source="project.baseUrls" @save="saveUrls"></urllist>
                </div>
                <div v-else class="row">
                    <el-row class="row" style="height: 60px">
                        <h4 style="margin-left: 10px;color: gray">
                            修改项目成员
                        </h4>
                    </el-row>
                    <el-row class="row" style="height: 50px">
                        <el-col class="col" :span="4" style="line-height: 50px;font-size: 15px;text-align: center;white-space: nowrap">
                            邀请用户
                        </el-col>
                        <el-col class="col" :span="12" style="text-align: center">
                            <el-input placeholder="输入邀请的用户名" style="margin-top: 8px;width: 80%" v-model="name"></el-input>
                        </el-col>
                        <el-col class="col" :span="4" style="text-align: center">
                            <el-select style="margin-top: 8px" style="width: 80%" v-model="role">
                                <el-option :value="1" label="观察者"></el-option>
                                <el-option :value="0" label="管理员"></el-option>
                            </el-select>
                        </el-col>
                        <el-col class="col" :span="4" style="line-height: 50px;text-align: center">
                            <el-button type="primary" style="font-size: 15px" @click="invite" :loading="invitePending">
                                邀请
                            </el-button>
                        </el-col>
                    </el-row>
                    <el-row class="row" style="height: 1px;background-color:rgb(247,246,242);margin: 10px 0 0 10px"></el-row>
                    <useredit :arr="project.users"></useredit>
                </div>
            </div>
        </el-col>
    </el-row>
</div>
<script src="../../dist/vendor.bundle.js"></script>
<script src="../lib/element/index.js"></script>
<script src="../../dist/projectset.js"></script>
</body>
</html>